<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2048 游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>2048</h1>
            <div class="score-container">
                <div class="score-box">
                    <span class="score-label">分数</span>
                    <span class="score" id="score">0</span>
                </div>
                <div class="score-box">
                    <span class="score-label">最高分</span>
                    <span class="score" id="best-score">0</span>
                </div>
            </div>
        </div>
        
        <div class="controls">
            <button class="restart-btn" onclick="game.restart()">重新开始</button>
        </div>
        
        <div class="game-container">
            <div class="grid-container">
                <div class="grid-row">
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                </div>
                <div class="grid-row">
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                </div>
                <div class="grid-row">
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                </div>
                <div class="grid-row">
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                    <div class="grid-cell"></div>
                </div>
            </div>
            
            <div class="tile-container" id="tile-container">
                <!-- 动态生成的方块将在这里显示 -->
            </div>
        </div>
        
        <div class="game-message" id="game-message">
            <p></p>
            <div class="lower">
                <button class="retry-button" onclick="game.restart()">再试一次</button>
            </div>
        </div>
        
        <div class="instructions">
            <p><strong>玩法：</strong>使用方向键移动方块！当两个相同数字的方块碰到一起时，它们会合并成一个！</p>
        </div>
    </div>
    
    <script src="game.js"></script>
</body>
</html>
